#include <iostream>
#include <vector>
#include <algorithm>

int main() {
    // 创建并初始化一个vector
    std::vector<int> numbers = {1, 3, 2, 8, 5, 4};

    // 使用max_element找到vector中的最大值的迭代器
    auto max_iter = std::max_element(numbers.begin(), numbers.end());

    // 输出最大值
    if (max_iter != numbers.end()) {
        std::cout << "The maximum value in the vector is: " << *max_iter << std::endl;
    } else {
        std::cout << "The vector is empty." << std::endl;
    }

    return 0;
}